class ReportValidator < ActiveModel::Validator
  def validate(record)
    now = DateTime.now
    conference = record.conference

    unless conference.opened?
      record.errors.add(:base, ActionController::Base.helpers.t('errors.report.conference_not_opened')) if conference.not_opened?
      record.errors.add(:base, ActionController::Base.helpers.t('errors.report.conference_closed')) if conference.closed?
    end
  end
end
